<?php

namespace Home\Model;
use Think\Model;
class XiamenModel extends Model{
    
    public function XiamenEdit($post,$file1,$file2,$file3){
        $arr = array(
            'rootPath'  => WORKING_PATH.UPLOAD_ROOT_PATH
            );
        $upload = new \Think\Upload($arr);
        if(!$file1['error']){
            $info1 = $upload -> uploadOne($file1);
            $post['img1']= UPLOAD_ROOT_PATH . $info1['savepath'].$info1['savename'];
        }
        if(!$file2['error']){
            $info2 = $upload -> uploadOne($file2);
            $post['img2']= UPLOAD_ROOT_PATH . $info2['savepath'].$info2['savename'];
        }
        if(!$file3['error']){
            $info3 = $upload -> uploadOne($file3);
            $post['img3']= UPLOAD_ROOT_PATH . $info3['savepath'].$info3['savename'];
        }
        $post['id']=1;
        return $this->save($post);
    }
}